#include<bits/stdc++.h>
using namespace std;

class Solution {
public:
    int findContentChildren(vector<int>& g, vector<int>& s) {
        sort(g.begin(), g.end());
        sort(s.begin(), s.end());
        int biscuit, child;
        biscuit = child = 0;
        while(biscuit<s.size() && child<g.size()){
            if(s[biscuit]>=g[child]) ++child;
            ++biscuit;
        }
        return child;
    }
};

